<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
  <title>社交网站手机端顶部导航</title>
  <!-- Bootstrap 5 CSS -->
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
  <!-- Font Awesome -->
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css">
  
  <style>
    :root {
      --primary: #1877F2; /* 社交主题色 */
      --secondary: #6c757d;
      --light: #f8f9fa;
      --dark: #343a40;
      --white: #ffffff;
      --border: #eee;
      --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    }
    
    body {
      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
      background-color: #f5f5f5;
      color: var(--dark);
      min-height: 100vh;
      padding: 0;
      margin: 0;
    }
    
    .container {
      max-width: 420px;
      margin: 0 auto;
      background-color: var(--white);
      min-height: 100vh;
      box-shadow: var(--shadow);
      overflow: hidden;
      position: relative;
    }
    
    /* 顶部导航栏基础样式 */
    .top-nav {
      background-color: var(--white);
      border-bottom: 1px solid var(--border);
      position: sticky;
      top: 0;
      z-index: 1000;
    }
    
    /* 主导航栏 */
    .main-nav {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 12px 15px;
    }
    
    .logo {
      font-size: 20px;
      font-weight: 700;
      color: var(--primary);
      text-decoration: none;
      display: flex;
      align-items: center;
      gap: 8px;
    }
    
    .nav-actions {
      display: flex;
      gap: 15px;
      align-items: center;
    }
    
    .action-btn {
      background: none;
      border: none;
      color: var(--dark);
      font-size: 20px;
      cursor: pointer;
      width: 36px;
      height: 36px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      position: relative;
      transition: background-color 0.2s;
    }
    
    .action-btn:hover {
      background-color: rgba(0, 0, 0, 0.05);
    }
    
    .notification-badge {
      position: absolute;
      top: 2px;
      right: 2px;
      width: 18px;
      height: 18px;
      border-radius: 50%;
      background-color: var(--primary);
      color: white;
      font-size: 10px;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    
    .user-avatar {
      width: 36px;
      height: 36px;
      border-radius: 50%;
      object-fit: cover;
      border: 2px solid transparent;
      cursor: pointer;
      transition: border-color 0.2s;
    }
    
    .user-avatar:hover {
      border-color: var(--primary);
    }
    
    /* 二级导航菜单 - 可横向滚动 */
    .secondary-nav {
      display: flex;
      overflow-x: auto;
      padding: 0 15px 10px;
      gap: 10px;
      scrollbar-width: none; /* 隐藏滚动条 */
    }
    
    .secondary-nav::-webkit-scrollbar {
      display: none; /* 隐藏滚动条 */
    }
    
    .nav-tab {
      padding: 6px 14px;
      white-space: nowrap;
      border-radius: 20px;
      font-size: 14px;
      font-weight: 500;
      color: var(--secondary);
      text-decoration: none;
      transition: all 0.2s;
    }
    
    .nav-tab.active {
      background-color: var(--primary);
      color: white;
    }
    
    .nav-tab:hover:not(.active) {
      background-color: rgba(0, 0, 0, 0.05);
      color: var(--dark);
    }
    
    /* 搜索栏 */
    .search-bar {
      padding: 8px 15px;
      border-bottom: 1px solid var(--border);
    }
    
    .search-input-group {
      position: relative;
    }
    
    .search-input {
      width: 100%;
      padding: 10px 15px 10px 40px;
      border: 1px solid var(--border);
      border-radius: 20px;
      font-size: 14px;
      outline: none;
      background-color: #f5f5f5;
      transition: all 0.2s;
    }
    
    .search-input:focus {
      border-color: var(--primary);
      background-color: white;
    }
    
    .search-icon {
      position: absolute;
      left: 15px;
      top: 50%;
      transform: translateY(-50%);
      color: var(--secondary);
      font-size: 16px;
    }
    
    /* 内容区域 */
    .content-area {
      padding: 15px;
    }
    
    .feed-item {
      background-color: white;
      border-radius: 12px;
      box-shadow: var(--shadow);
      overflow: hidden;
      margin-bottom: 15px;
    }
    
    .feed-header {
      padding: 12px 15px;
      display: flex;
      justify-content: space-between;
      align-items: center;
    }
    
    .user-info {
      display: flex;
      align-items: center;
      gap: 10px;
    }
    
    .feed-avatar {
      width: 40px;
      height: 40px;
      border-radius: 50%;
      object-fit: cover;
    }
    
    .user-name {
      font-weight: 600;
      font-size: 15px;
    }
    
    .post-time {
      font-size: 12px;
      color: var(--secondary);
    }
    
    .more-btn {
      background: none;
      border: none;
      color: var(--secondary);
      cursor: pointer;
      font-size: 16px;
    }
    
    .feed-content {
      padding: 0 15px 12px;
    }
    
    .feed-text {
      font-size: 15px;
      margin-bottom: 10px;
    }
    
    .feed-image {
      width: 100%;
      height: 220px;
      object-fit: cover;
      border-radius: 8px;
    }
    
    /* 用户个人中心顶部 */
    .profile-header {
      background: linear-gradient(135deg, #4267B2, var(--primary));
      color: white;
      padding: 25px 15px 15px;
      position: relative;
    }
    
    .back-btn {
      position: absolute;
      top: 15px;
      left: 15px;
      background: none;
      border: none;
      color: white;
      font-size: 20px;
      cursor: pointer;
      z-index: 10;
    }
    
    .profile-cover {
      width: 100%;
      height: 120px;
      background-color: #eee;
      border-radius: 12px;
      overflow: hidden;
      margin-bottom: -50px;
      position: relative;
      z-index: 1;
    }
    
    .cover-image {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }
    
    .profile-info {
      display: flex;
      justify-content: space-between;
      align-items: flex-end;
      position: relative;
      z-index: 2;
      padding-top: 60px;
    }
    
    .profile-avatar-container {
      position: relative;
    }
    
    .profile-avatar {
      width: 100px;
      height: 100px;
      border-radius: 50%;
      object-fit: cover;
      border: 4px solid white;
    }
    
    .edit-avatar {
      position: absolute;
      bottom: 5px;
      right: 5px;
      width: 30px;
      height: 30px;
      border-radius: 50%;
      background-color: var(--primary);
      color: white;
      border: none;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      font-size: 14px;
    }
    
    .profile-actions {
      display: flex;
      gap: 10px;
    }
    
    .profile-btn {
      padding: 6px 16px;
      border-radius: 6px;
      font-weight: 500;
      font-size: 14px;
      cursor: pointer;
      transition: all 0.2s;
    }
    
    .follow-btn {
      background-color: var(--primary);
      color: white;
      border: none;
    }
    
    .message-btn {
      background-color: white;
      color: var(--primary);
      border: 1px solid var(--primary);
    }
    
    .profile-details {
      padding: 15px;
    }
    
    .profile-name {
      font-size: 20px;
      font-weight: 700;
      margin-bottom: 5px;
    }
    
    .profile-bio {
      font-size: 14px;
      color: var(--secondary);
      margin-bottom: 15px;
    }
    
    .profile-stats {
      display: flex;
      gap: 20px;
      margin-bottom: 15px;
    }
    
    .stat-item {
      display: flex;
      flex-direction: column;
    }
    
    .stat-value {
      font-weight: 700;
      font-size: 16px;
    }
    
    .stat-label {
      font-size: 12px;
      color: var(--secondary);
    }
    
    /* 页面切换样式 */
    .page {
      display: none;
      min-height: 100vh;
      flex-direction: column;
    }
    
    .page.active {
      display: flex;
    }
    
    /* 动画效果 */
    @keyframes fadeIn {
      from { opacity: 0; transform: translateY(10px); }
      to { opacity: 1; transform: translateY(0); }
    }
    
    .page.active {
      animation: fadeIn 0.3s ease forwards;
    }
    
    /* 响应式调整 */
    @media (max-width: 360px) {
      .nav-tab {
        padding: 5px 12px;
        font-size: 13px;
      }
      
      .profile-btn {
        padding: 5px 12px;
        font-size: 13px;
      }
    }
  </style>
</head>
<body>
  <div class="container">
    <!-- 首页 - 带多菜单顶部导航 -->
    <div class="page active" id="homePage">
      <!-- 顶部导航区域 -->
      <div class="top-nav">
        <!-- 主导航栏 -->
        <div class="main-nav">
          <a href="#" class="logo">
            <i class="fa fa-connectdevelop"></i>
            <span>社交圈</span>
          </a>
          
          <div class="nav-actions">
            <button class="action-btn">
              <i class="fa fa-plus-square-o"></i>
            </button>
            <button class="action-btn">
              <i class="fa fa-bell-o"></i>
              <span class="notification-badge">3</span>
            </button>
            <img src="https://picsum.photos/id/64/100" alt="用户头像" class="user-avatar" id="profileToggle">
          </div>
        </div>
        
        <!-- 搜索栏 -->
        <div class="search-bar">
          <div class="search-input-group">
            <i class="fa fa-search search-icon"></i>
            <input type="text" class="search-input" placeholder="搜索好友、内容或话题...">
          </div>
        </div>
        
        <!-- 二级导航菜单 -->
        <div class="secondary-nav">
          <a href="#" class="nav-tab active">推荐</a>
          <a href="#" class="nav-tab">关注</a>
          <a href="#" class="nav-tab">热门</a>
          <a href="#" class="nav-tab">话题</a>
          <a href="#" class="nav-tab">附近</a>
          <a href="#" class="nav-tab">直播</a>
          <a href="#" class="nav-tab">游戏</a>
        </div>
      </div>
      
      <!-- 内容区域 -->
      <div class="content-area flex-grow-1 overflow-y-auto">
        <div class="feed-item">
          <div class="feed-header">
            <div class="user-info">
              <img src="https://picsum.photos/id/65/100" alt="用户头像" class="feed-avatar">
              <div>
                <div class="user-name">李明</div>
                <div class="post-time">2小时前</div>
              </div>
            </div>
            <button class="more-btn">
              <i class="fa fa-ellipsis-h"></i>
            </button>
          </div>
          <div class="feed-content">
            <div class="feed-text">今天的天气真不错，适合出去走走！#周末 #阳光</div>
            <img src="https://picsum.photos/id/1015/800/600" alt="动态图片" class="feed-image">
          </div>
        </div>
        
        <div class="feed-item">
          <div class="feed-header">
            <div class="user-info">
              <img src="https://picsum.photos/id/66/100" alt="用户头像" class="feed-avatar">
              <div>
                <div class="user-name">张婷</div>
                <div class="post-time">昨天</div>
              </div>
            </div>
            <button class="more-btn">
              <i class="fa fa-ellipsis-h"></i>
            </button>
          </div>
          <div class="feed-content">
            <div class="feed-text">新尝试的蛋糕配方，味道还不错😊</div>
            <img src="https://picsum.photos/id/292/800/600" alt="动态图片" class="feed-image">
          </div>
        </div>
      </div>
    </div>
    
    <!-- 用户个人中心页面 -->
    <div class="page" id="profilePage">
      <!-- 个人中心顶部区域 -->
      <div class="profile-header">
        <button class="back-btn" id="backToHome">
          <i class="fa fa-arrow-left"></i>
        </button>
        
        <div class="profile-cover">
          <img src="https://picsum.photos/id/1048/800/400" alt="封面图" class="cover-image">
        </div>
        
        <div class="profile-info">
          <div class="profile-avatar-container">
            <img src="https://picsum.photos/id/64/200" alt="个人头像" class="profile-avatar">
            <button class="edit-avatar">
              <i class="fa fa-camera"></i>
            </button>
          </div>
          
          <div class="profile-actions">
            <button class="profile-btn follow-btn">关注</button>
            <button class="profile-btn message-btn">私信</button>
          </div>
        </div>
      </div>
      
      <!-- 个人资料详情 -->
      <div class="profile-details">
        <div class="profile-name">陈宇轩</div>
        <div class="profile-bio">热爱生活，喜欢旅行和摄影，记录美好瞬间。</div>
        
        <div class="profile-stats">
          <div class="stat-item">
            <span class="stat-value">248</span>
            <span class="stat-label">动态</span>
          </div>
          <div class="stat-item">
            <span class="stat-value">1.2k</span>
            <span class="stat-label">粉丝</span>
          </div>
          <div class="stat-item">
            <span class="stat-value">356</span>
            <span class="stat-label">关注</span>
          </div>
        </div>
        
        <!-- 个人中心二级导航 -->
        <div class="secondary-nav" style="padding-top: 10px;">
          <a href="#" class="nav-tab active">动态</a>
          <a href="#" class="nav-tab">相册</a>
          <a href="#" class="nav-tab">收藏</a>
          <a href="#" class="nav-tab">喜欢</a>
        </div>
      </div>
      
      <!-- 个人中心内容 -->
      <div class="content-area">
        <div class="feed-item">
          <div class="feed-content">
            <div class="feed-text">在大理的美好时光 #旅行 #大理</div>
            <img src="https://picsum.photos/id/1036/800/600" alt="动态图片" class="feed-image">
          </div>
        </div>
        
        <div class="feed-item">
          <div class="feed-content">
            <div class="feed-text">新买的相机，试拍几张 #摄影 #器材</div>
            <img src="https://picsum.photos/id/1018/800/600" alt="动态图片" class="feed-image">
          </div>
        </div>
      </div>
    </div>
  </div>
  
  <!-- Bootstrap JS -->
  <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
  
  <script>
    // DOM元素
    const profileToggle = document.getElementById('profileToggle');
    const backToHome = document.getElementById('backToHome');
    const homePage = document.getElementById('homePage');
    const profilePage = document.getElementById('profilePage');
    const navTabs = document.querySelectorAll('.nav-tab');
    
    // 初始化
    function init() {
      // 页面切换事件
      profileToggle.addEventListener('click', function() {
        homePage.classList.remove('active');
        profilePage.classList.add('active');
      });
      
      backToHome.addEventListener('click', function() {
        profilePage.classList.remove('active');
        homePage.classList.add('active');
      });
      
      // 导航标签切换
      navTabs.forEach(tab => {
        tab.addEventListener('click', function(e) {
          e.preventDefault();
          
          // 只处理当前页面的导航标签
          const currentPage = this.closest('.page');
          const pageTabs = currentPage.querySelectorAll('.nav-tab');
          
          pageTabs.forEach(t => t.classList.remove('active'));
          this.classList.add('active');
        });
      });
      
      // 添加交互效果
      addInteractionEffects();
    }
    
    // 添加交互效果
    function addInteractionEffects() {
      // 搜索框焦点效果
      const searchInput = document.querySelector('.search-input');
      if (searchInput) {
        searchInput.addEventListener('focus', function() {
          this.parentElement.classList.add('focused');
        });
        
        searchInput.addEventListener('blur', function() {
          this.parentElement.classList.remove('focused');
        });
      }
      
      // 按钮悬停效果已通过CSS实现
      // 可根据需要添加更多交互效果
    }
    
    // 启动
    init();
  </script>
</body>
</html>
